//
//  GameInfo.h
//  test
//
//  Created by songxiao on 13-12-25.
//
//

#pragma once

#include "cocos2d.h"
#include "TcpClientShort.h"
using namespace cocos2d;
using namespace extension;

typedef int (CCObject::*SEL_CallFunc_GetFormation)(unsigned char* data, int size);

int getAutoMatchFormation(int exp, SEL_CallFunc_GetFormation selector, CCObject* target);

class GameInfo : public CCObject
{
public:
    
    GameInfo() {}
    GameInfo(CCObject* pObject, SEL_CallFunc_GetFormation pSeletor)
    {
        _pObject = NULL;
        _pSeletor = NULL;
        if(pObject)
            _pObject = pObject;
        _pSeletor = pSeletor;
    }
    
    void getGameInfo(unsigned int uid);
    
    void getGameInfoCallback(CCNode* pNode, void* sData);

private:
    CCObject* _pObject;
    SEL_CallFunc_GetFormation _pSeletor;
};